CC=gcc
CFLAGS=-c
EXE=chatcli
all: $(EXE)
$(EXE): chatcli.o readline.o writen.o logger.o setup.o
	$(CC) chatcli.o logger.o setup.o readline.o writen.o -pthread -lncurses -o $(EXE)
chatcli.o: chatcli.c
	$(CC) $(CFLAGS) chatcli.c
readline.o: readline.c
	$(CC) $(CFLAGS) readline.c
writen.o: writen.c
	$(CC) $(CFLAGS) writen.c
logger.o: logger.c
	$(CC) $(CFLAGS) logger.c
setup.o: setup.c
	$(CC) $(CFLAGS) setup.c
clean:
	rm -rf *.o $(EXE) *~
